home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / BORUSR2.ZIP;1 / CONFIG.PRG < prev    next >
Encoding:
Text File  |  1992-06-16  |  6.3 KB  |  229 lines

  1. *-------------------------------------------------------------------------------
  2. *-- Program...: CONFIG.PRG
  3. *-- Programmer: Ken Mayer
  4. *-- Date......: 06/12/1992
  5. *-- Notes.....: This is a small program designed to handle calling the 
  6. *--             appropriate configuration programs (color/printer). 
  7. *-------------------------------------------------------------------------------
  8.  
  9. save screen to sConfig
  10. cConColor = set("ATTRIBUTE")
  11. clear
  12. x=scrnhead("&cStand2","Configuration of BOR-BBS USERS System")
  13. lColorchg = .f.   && used just inside the loop
  14. set safety off    && turn it off for some of the processing here ...
  15.  
  16. *--------------------------------------------------------------------------
  17. *-- Removed the 'outer loop' here ...
  18. *--------------------------------------------------------------------------
  19.     
  20.     cConfig = " "
  21.     @12,10 say "Configure [C]olors or [P]rinters? " get cConfig;
  22.         picture "!" valid required cConfig $ " CP";
  23.         error chr(7)+"Enter 'C' or 'P'"
  24.     @14,10 say "Press <Enter> to return to menu ..."
  25.     read
  26.     
  27.     if cConfig = "C"
  28.     
  29.         lMono = .f.
  30.         lVGA = .f.
  31.         
  32.         @14,0 clear
  33.         if upper(cStand) = "W+/N" .or. iscolor() = .f.  && we have monochrome
  34.             lMono = .t.
  35.         endif
  36.         if file("CLRDESC.MEM")     && we have (theoretically) VGA
  37.            lVGA = .t.
  38.         endif
  39.         
  40.         *-- if we have VGA, we need to ask some questions ...
  41.         if lVGA
  42.             cYN = " "
  43.             @14,10 say "You have currently have VGA as your setup."
  44.             @15,10 say "Do you wish to change this? " get cYN picture "!";
  45.                 valid required cYN $ "YN" error chr(7)+"Enter 'Y' or 'N'"
  46.             @17,10 say "(Change to Monochrome or non-VGA?)"
  47.             read
  48.             
  49.             if cYN = "N"
  50.                 @16,0 clear
  51.                 cYN = " "
  52.                 *-- change the values of the 'guns'?
  53.                 @17,10 say "Do you wish to change the color values of the VGA?";
  54.                     get cYN picture "!" valid required cYN $ "YN";
  55.                     error chr(7)+"Enter 'Y' or 'N'"
  56.                 @18,10 say "This option only changes VGA Scale colors, not"
  57.                 @19,10 say "colors assigned in programs. See documentation file"
  58.                 @20,10 say "COLORCTL.TXT attached ..."
  59.                 
  60.                 read
  61.                 if cYN = "Y"
  62.                     do setclr  && program to toy with vga scale colors ...
  63.                     lColorchg = .t.
  64.                 endif
  65.                 
  66.             else   && user wants to change to either mono or non-vga color
  67.                 
  68.                 *-- first, we remove the VGA descriptions ...
  69.                 save screen to sVGA
  70.                 set console off
  71.                 erase clrdesc.mem  && delete file
  72.                 copy file clrdesc.def to clrdesc.mem
  73.                 do cdefault
  74.                 erase clrdesc.mem
  75.                 lcolorchg = .t.
  76.                 set console on
  77.                 restore screen from sVGA
  78.                 release screen sVGA
  79.                 
  80.                 *-- next we ask if they want MONO or "regular" color?
  81.                 cYN = " "
  82.                 @16,0 clear
  83.                 @17,10 say "Do you wish to change to monochrome? " get cYN;
  84.                     picture "!" valid required cYN $ "YN";
  85.                     error chr(7)+"Enter 'Y' or 'N'"
  86.                 read
  87.                 
  88.                 if cYN = "Y"  && change to mono
  89.                     
  90.                     do mono
  91.                     
  92.                 endif  && cYN = "Y" 
  93.                 
  94.             endif  && cYN = "N"  -- change to mono or non-vga
  95.             
  96.         endif  && lVGA
  97.         
  98.         if lMono
  99.             cYN = " "
  100.             @14,10 say "You currently have monochrome."
  101.             @15,10 say "Do you wish to change this to color?" get cYN;
  102.                 picture "!" valid required cYN $ "YN";
  103.                 error chr(7)+"Enter 'Y' or 'N'"
  104.             read
  105.             
  106.             if cYN = "Y"
  107.                 
  108.                 @12,0 clear
  109.                 do colors
  110.                 
  111.                 lColorChg = .t.
  112.                 *-- check for VGA ...
  113.                 if yesno(.t.,"Do you have VGA?","","","&cl_wind1")
  114.                     set safety off
  115.                     copy file clrdesc.fil to clrdesc.mem
  116.                     set safety on
  117.                 endif
  118.             endif
  119.             
  120.         endif && lMono
  121.         
  122.         *-- we have color, but not mono, and not vga ...
  123.         if .not. lMono .and. .not. lVGA
  124.         
  125.             @12, 0 clear
  126.             @14,10 say "You are not set for monochrome or VGA."
  127.             @15,10 say "You ARE set for 'normal' color."
  128.             cYN = " "
  129.             @16,10 say "Do you wish to change this? " get cYN picture "!";
  130.                 valid required cYN $ "YN" error chr(7)+"Enter 'Y' or 'N'"
  131.             read
  132.             
  133.             if cYN = "Y"
  134.                 lColorChg = .t.
  135.                 @14, 0 clear
  136.                 if yesno(.f.,"Change to Monochrome?","Yes=Monochrome","No=VGA",;
  137.                               "&cl_wind1")
  138.                     
  139.                     do mono         && routine below to deal with monochrome
  140.                     
  141.                 *-- VGA
  142.                 else
  143.                     set console off
  144.                     copy file clrdesc.fil to clrdesc.mem
  145.                     do cdefault
  146.                     set console on
  147.                 endif  && yesno()
  148.             endif
  149.             
  150.         endif   && .not. mono/vga
  151.     
  152.     endif && cConfig = "C"
  153.     
  154.     if cConfig = "P"
  155.         
  156.         do pConfig    && printer configuration routine by Bowen Moursund,
  157.                       && heavily modified by yours truly.
  158.     endif  && cConfig = "P"
  159.     
  160. *-- used to be an ENDDO here, but removed ...
  161. @5,0 clear
  162. if lColorChg
  163.     @7,12 say "You have changed your colors. To see the changes,"
  164.     @8,12 say "choose the menu option: 'Exit to dBASE',"
  165.     @9,12 say "and restart the system (DO MENU) at the 'dot' prompt."
  166.     set cursor off
  167.     x=inkey(0)
  168.     set cursor on
  169. endif
  170.  
  171. *-- Cleanup
  172. restore screen from sConfig
  173. release screen sConfig
  174. do ReColor with cConColor    && reset colors
  175. set safety on  && turn it back on
  176. RETURN
  177.  
  178. *-------------------------------------------------------------------------------
  179. *-- End of Program: CONFIG.PROG
  180. *-------------------------------------------------------------------------------
  181.  
  182. PROCEDURE Mono
  183.  
  184.     *-- set monochrome ...
  185.     if iscolor() && not a monochrome card
  186.         cStand = "w+/n"
  187.         cStand2 = "n/w"
  188.         cStand3 = "n+/w"
  189.     else
  190.         cStand = "w/n"
  191.         cStand2 = "wI/N"
  192.         cStand3 = "wU/n"
  193.     endif
  194.     *-- now we have the 'colors', let's set all the 'usual' stuff
  195.     set safety off
  196.     save all like cStand* to color
  197.     set safety on
  198.     cl_wind1 = "&cStand2,&cStand,&cStand2"
  199.     cl_wind2 = "&cStand3,&cStand2,&cStand3"
  200.     cl_wind3 = "&cStand,&cStand2,&cStand"
  201.     *-- set 'main' colors
  202.     set color of normal to    &cStand
  203.     set color of message to   &cStand2
  204.     set color of box     to   &cStand2
  205.     set color of highlight to &cStand
  206.                 
  207. RETURN
  208.  
  209. PROCEDURE Colors
  210.  
  211.     cStand = "W+/b"
  212.     cStand2 = "rg+/gb"
  213.     cStand3 = "rg+/r"
  214.     
  215.     *-- now we have the 'colors', let's set all the 'usual' stuff
  216.     set safety off
  217.     save all like cStand* to color
  218.     set safety on
  219.     cl_wind1 = "&cStand2,&cStand,&cStand2"
  220.     cl_wind2 = "&cStand3,&cStand2,&cStand3"
  221.     cl_wind3 = "&cStand,&cStand2,&cStand"
  222.     *-- set 'main' colors
  223.     set color of normal to    &cStand
  224.     set color of message to   &cStand2
  225.     set color of box     to   &cStand2
  226.     set color of highlight to &cStand
  227.  
  228. RETURN
  229.